{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "4c03cd7e",
   "metadata": {
    "id": "4c03cd7e"
   },
   "source": [
    "# ⚖️ AI-CourtSimulation - Mini Court Simulation\n",
    "\n",
    "A simplified court case simulation with essential AI agents."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "k0GmORjCRMGL",
   "metadata": {
    "id": "k0GmORjCRMGL"
   },
   "source": [
    "[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Dhivya-Bharathy/PraisonAI/blob/main/examples/cookbooks/LegaliaAI_MiniCourt.ipynb)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "98fc3316",
   "metadata": {
    "id": "98fc3316"
   },
   "source": [
    "## Install Dependencies"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bb57c529",
   "metadata": {
    "id": "bb57c529"
   },
   "outputs": [],
   "source": [
    "!pip install praisonaiagents openai python-dotenv"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cfdb1a0c",
   "metadata": {
    "id": "cfdb1a0c"
   },
   "source": [
    "## Import Libraries & Setup"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f7c5e0a6",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "f7c5e0a6",
    "outputId": "20b3baf7-6099-4c35-8ec8-9d5659553c30"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "✅ Setup complete!\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "from dotenv import load_dotenv\n",
    "from IPython.display import display, HTML\n",
    "import time\n",
    "\n",
    "load_dotenv()\n",
    "\n",
    "# Setup API key\n",
    "api_key = os.getenv('OPENAI_API_KEY')\n",
    "if not api_key:\n",
    "    print(\"🔑 Enter your OpenAI API key:\")\n",
    "    api_key = input(\"API Key: \").strip()\n",
    "    os.environ['OPENAI_API_KEY'] = \"Enter your api key\"\n",
    "\n",
    "print(\"✅ Setup complete!\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b6c7c2f3",
   "metadata": {
    "id": "b6c7c2f3"
   },
   "source": [
    "## Create Mini Agents"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6d7a8426",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "6d7a8426",
    "outputId": "7851dfcc-14e1-4714-fc84-f26289d87dcf"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "✅ Mini agents created!\n"
     ]
    }
   ],
   "source": [
    "from praisonaiagents import Agent\n",
    "\n",
    "# Judge Agent\n",
    "judge = Agent(\n",
    "    name=\"Judge\",\n",
    "    role=\"Preside over court proceedings\",\n",
    "    llm=\"gpt-5-nano\",\n",
    "    instructions=[\n",
    "        \"You are an impartial judge\",\n",
    "        \"Make fair decisions based on evidence\",\n",
    "        \"Keep responses under 100 words\"\n",
    "    ],\n",
    "    markdown=True\n",
    ")\n",
    "\n",
    "# Prosecutor Agent\n",
    "prosecutor = Agent(\n",
    "    name=\"Prosecutor\",\n",
    "    role=\"Present case against defendant\",\n",
    "    llm=\"gpt-5-nano\",\n",
    "    instructions=[\n",
    "        \"You are a prosecutor seeking conviction\",\n",
    "        \"Present evidence methodically\",\n",
    "        \"Keep responses under 80 words\"\n",
    "    ],\n",
    "    markdown=True\n",
    ")\n",
    "\n",
    "# Defense Agent\n",
    "defense = Agent(\n",
    "    name=\"Defense\",\n",
    "    role=\"Defend the accused\",\n",
    "    llm=\"gpt-5-nano\",\n",
    "    instructions=[\n",
    "        \"You are a defense attorney\",\n",
    "        \"Create reasonable doubt\",\n",
    "        \"Keep responses under 80 words\"\n",
    "    ],\n",
    "    markdown=True\n",
    ")\n",
    "\n",
    "# Witness Agent\n",
    "witness = Agent(\n",
    "    name=\"Witness\",\n",
    "    role=\"Provide testimony\",\n",
    "    llm=\"gpt-5-nano\",\n",
    "    instructions=[\n",
    "        \"You are a witness testifying\",\n",
    "        \"Provide factual testimony\",\n",
    "        \"Keep responses under 60 words\"\n",
    "    ],\n",
    "    markdown=True\n",
    ")\n",
    "\n",
    "print(\"✅ Mini agents created!\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "eMSO8H5jQx5O",
   "metadata": {
    "id": "eMSO8H5jQx5O"
   },
   "source": [
    "# Case Details Input"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fAIzu_3vPaHJ",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "fAIzu_3vPaHJ",
    "outputId": "1df808db-e911-4e9f-ccf4-8c101040f89a"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Case Title (e.g., 'State vs. Smith'): Doe vs. Wilson\n",
      "Case Description: The plaintiff claims to have suffered emotional distress due to repeated online harassment\n",
      "Key Evidence: Screenshots of messages, social media posts, therapist’s report\n",
      "\n",
      "📋 Case: Doe vs. Wilson\n",
      "📝 Description: The plaintiff claims to have suffered emotional distress due to repeated online harassment\n",
      "🔍 Evidence: Screenshots of messages, social media posts, therapist’s report\n"
     ]
    }
   ],
   "source": [
    "# Simple case details\n",
    "case_title = input(\"Case Title (e.g., 'State vs. Smith'): \") or \"State vs. Smith\"\n",
    "case_description = input(\"Case Description: \") or \"Theft case involving stolen laptop\"\n",
    "evidence = input(\"Key Evidence: \") or \"Security camera footage and witness testimony\"\n",
    "\n",
    "print(f\"\\n📋 Case: {case_title}\")\n",
    "print(f\"📝 Description: {case_description}\")\n",
    "print(f\"🔍 Evidence: {evidence}\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6e418e95",
   "metadata": {
    "id": "6e418e95"
   },
   "source": [
    "# Helper Functions (Fixed with .start())## Cell 4: Case Details Input"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fd9da25c",
   "metadata": {
    "id": "fd9da25c"
   },
   "outputs": [],
   "source": [
    "# Display function\n",
    "def show_message(name, role, message, color=\"#4CAF50\"):\n",
    "    html = f\"\"\"\n",
    "    <div style=\"\n",
    "        background: {color};\n",
    "        color: white;\n",
    "        padding: 15px;\n",
    "        border-radius: 10px;\n",
    "        margin: 10px 0;\n",
    "    \">\n",
    "        <strong>⚖️ {name}</strong> • <em>{role}</em><br>\n",
    "        <div style=\"margin-top: 10px;\">{message}</div>\n",
    "    </div>\n",
    "    \"\"\"\n",
    "    display(HTML(html))\n",
    "\n",
    "# Run agent using .start()\n",
    "def run_agent(agent, prompt, name, role, color=\"#4CAF50\"):\n",
    "    try:\n",
    "        response = agent.start(prompt)\n",
    "        show_message(name, role, response, color)\n",
    "        return response\n",
    "    except Exception as e:\n",
    "        show_message(\"System\", \"Error\", str(e), \"#f44336\")\n",
    "        return \"\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bb089a4e",
   "metadata": {
    "id": "bb089a4e"
   },
   "source": [
    "## Mini Court Simulation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ade19755",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 1000,
     "referenced_widgets": [
      "74964427de63470da100903aac0b8c78",
      "45ff535d008a4b30b53a0e72edee016b",
      "9e740fc3b45c454e96dfe29b4c0edb53",
      "c04a2ce5fcc544d8ac72aa67776c0fd0",
      "c0c194ce705f4418961c84f0bacb1acf",
      "4ef74a10d03747608c9011027bfa877c",
      "f4d166f4a67e41679066f05d4f224c31",
      "f47eec09409e440091431311f3048518",
      "801192cdda5e4736bc53dba478e1dcc1",
      "1928c67194d4409a9528a796bbe1fce1"
     ]
    },
    "id": "ade19755",
    "outputId": "b6259040-2eb5-4f10-c6ac-0795d19c889c"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🚀 Starting Mini Court Simulation...\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<h2>📅 Day 1: Opening Statements</h2>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╭─ </span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8; font-weight: bold\">Agent Info</span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\"> ────────────────────────────────────────────────────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>                                                                                                                 <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #ff9b9b; text-decoration-color: #ff9b9b; font-weight: bold\">👤 Agent:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Judge</span>                                                                                                <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #b4b4b3; text-decoration-color: #b4b4b3; font-weight: bold\">Role:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Preside over court proceedings</span>                                                                           <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>                                                                                                                 <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[38;2;210;227;200m╭─\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[1;38;2;210;227;200mAgent Info\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[38;2;210;227;200m───────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\u001b[38;2;210;227;200m─╮\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m                                                                                                                 \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;255;155;155m👤 Agent:\u001b[0m \u001b[38;2;255;229;229mJudge\u001b[0m                                                                                                \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;180;180;179mRole:\u001b[0m \u001b[38;2;255;229;229mPreside over court proceedings\u001b[0m                                                                           \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m                                                                                                                 \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "74964427de63470da100903aac0b8c78",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Output()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">Response generated in 3.9s</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2mResponse generated in 3.9s\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> You are Judge presiding over \"Doe vs. Wilson\". Open the court proceedings professionally. Case: The plaintiff   <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> claims to have suffered emotional distress due to repeated online harassment Keep it brief and formal.          <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m│\u001b[0m You are Judge presiding over \"Doe vs. Wilson\". Open the court proceedings professionally. Case: The plaintiff   \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m claims to have suffered emotional distress due to repeated online harassment Keep it brief and formal.          \u001b[36m│\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> Court is now in session.                                                                                        <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span>                                                                                                                 <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> Case number 2023-001: Doe vs. Wilson. The plaintiff, Ms. Doe, alleges emotional distress resulting from         <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> repeated online harassment by the defendant, Mr. Wilson.                                                        <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span>                                                                                                                 <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> Both parties will present their evidence and arguments. I remind all present to maintain decorum.               <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span>                                                                                                                 <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> Let us proceed with the plaintiff's opening statement.                                                          <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m│\u001b[0m Court is now in session.                                                                                        \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m                                                                                                                 \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m Case number 2023-001: Doe vs. Wilson. The plaintiff, Ms. Doe, alleges emotional distress resulting from         \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m repeated online harassment by the defendant, Mr. Wilson.                                                        \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m                                                                                                                 \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m Both parties will present their evidence and arguments. I remind all present to maintain decorum.               \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m                                                                                                                 \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m Let us proceed with the plaintiff's opening statement.                                                          \u001b[36m│\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "    <div style=\"\n",
       "        background: #8B4513;\n",
       "        color: white;\n",
       "        padding: 15px;\n",
       "        border-radius: 10px;\n",
       "        margin: 10px 0;\n",
       "    \">\n",
       "        <strong>⚖️ Judge</strong> • <em>Presiding Judge</em><br>\n",
       "        <div style=\"margin-top: 10px;\">Court is now in session. \n",
       "\n",
       "Case number 2023-001: Doe vs. Wilson. The plaintiff, Ms. Doe, alleges emotional distress resulting from repeated online harassment by the defendant, Mr. Wilson. \n",
       "\n",
       "Both parties will present their evidence and arguments. I remind all present to maintain decorum. \n",
       "\n",
       "Let us proceed with the plaintiff's opening statement.</div>\n",
       "    </div>\n",
       "    "
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╭─ </span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8; font-weight: bold\">Agent Info</span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\"> ────────────────────────────────────────────────────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>                                                                                                                 <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #ff9b9b; text-decoration-color: #ff9b9b; font-weight: bold\">👤 Agent:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Prosecutor</span>                                                                                           <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #b4b4b3; text-decoration-color: #b4b4b3; font-weight: bold\">Role:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Present case against defendant</span>                                                                           <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>                                                                                                                 <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[38;2;210;227;200m╭─\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[1;38;2;210;227;200mAgent Info\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[38;2;210;227;200m───────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\u001b[38;2;210;227;200m─╮\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m                                                                                                                 \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;255;155;155m👤 Agent:\u001b[0m \u001b[38;2;255;229;229mProsecutor\u001b[0m                                                                                           \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;180;180;179mRole:\u001b[0m \u001b[38;2;255;229;229mPresent case against defendant\u001b[0m                                                                           \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m                                                                                                                 \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "9e740fc3b45c454e96dfe29b4c0edb53",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Output()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">Response generated in 3.1s</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2mResponse generated in 3.1s\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> You are the Prosecutor for \"Doe vs. Wilson\". Give your opening statement. Evidence: Screenshots of messages,    <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> social media posts, therapist’s report Be confident and factual.                                                <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m│\u001b[0m You are the Prosecutor for \"Doe vs. Wilson\". Give your opening statement. Evidence: Screenshots of messages,    \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m social media posts, therapist’s report Be confident and factual.                                                \u001b[36m│\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> Ladies and gentlemen of the jury, today we present clear evidence against the defendant, Wilson. We will show   <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> you screenshots of messages that reveal intent and motive, alongside social media posts that further            <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> corroborate this behavior. Additionally, a therapist’s report will demonstrate the psychological impact on the  <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> victim, Doe. This evidence will establish a pattern of harassment and intimidation. We ask you to consider the  <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> facts carefully and deliver a just verdict. Thank you.                                                          <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m│\u001b[0m Ladies and gentlemen of the jury, today we present clear evidence against the defendant, Wilson. We will show   \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m you screenshots of messages that reveal intent and motive, alongside social media posts that further            \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m corroborate this behavior. Additionally, a therapist’s report will demonstrate the psychological impact on the  \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m victim, Doe. This evidence will establish a pattern of harassment and intimidation. We ask you to consider the  \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m facts carefully and deliver a just verdict. Thank you.                                                          \u001b[36m│\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "    <div style=\"\n",
       "        background: #d32f2f;\n",
       "        color: white;\n",
       "        padding: 15px;\n",
       "        border-radius: 10px;\n",
       "        margin: 10px 0;\n",
       "    \">\n",
       "        <strong>⚖️ Prosecutor</strong> • <em>State Attorney</em><br>\n",
       "        <div style=\"margin-top: 10px;\">Ladies and gentlemen of the jury, today we present clear evidence against the defendant, Wilson. We will show you screenshots of messages that reveal intent and motive, alongside social media posts that further corroborate this behavior. Additionally, a therapist’s report will demonstrate the psychological impact on the victim, Doe. This evidence will establish a pattern of harassment and intimidation. We ask you to consider the facts carefully and deliver a just verdict. Thank you.</div>\n",
       "    </div>\n",
       "    "
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╭─ </span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8; font-weight: bold\">Agent Info</span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\"> ────────────────────────────────────────────────────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>                                                                                                                 <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #ff9b9b; text-decoration-color: #ff9b9b; font-weight: bold\">👤 Agent:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Defense</span>                                                                                              <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #b4b4b3; text-decoration-color: #b4b4b3; font-weight: bold\">Role:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Defend the accused</span>                                                                                       <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>                                                                                                                 <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[38;2;210;227;200m╭─\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[1;38;2;210;227;200mAgent Info\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[38;2;210;227;200m───────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\u001b[38;2;210;227;200m─╮\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m                                                                                                                 \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;255;155;155m👤 Agent:\u001b[0m \u001b[38;2;255;229;229mDefense\u001b[0m                                                                                              \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;180;180;179mRole:\u001b[0m \u001b[38;2;255;229;229mDefend the accused\u001b[0m                                                                                       \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m                                                                                                                 \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "c0c194ce705f4418961c84f0bacb1acf",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Output()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">Response generated in 3.3s</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2mResponse generated in 3.3s\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> You are the Defense Attorney for \"Doe vs. Wilson\". Give your opening statement. Challenge the prosecution's     <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> case. Emphasize presumption of innocence.                                                                       <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m│\u001b[0m You are the Defense Attorney for \"Doe vs. Wilson\". Give your opening statement. Challenge the prosecution's     \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m case. Emphasize presumption of innocence.                                                                       \u001b[36m│\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> Ladies and gentlemen of the jury, today you will hear the prosecution's case against my client, Mr. Wilson.     <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> However, I urge you to remember that the burden of proof lies with them. They must prove guilt beyond a         <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> reasonable doubt. We will show that the evidence is circumstantial, unreliable, and lacks credibility. Mr.      <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> Wilson is presumed innocent until proven guilty, and we will demonstrate that reasonable doubt exists in this   <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> case. Thank you.                                                                                                <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m│\u001b[0m Ladies and gentlemen of the jury, today you will hear the prosecution's case against my client, Mr. Wilson.     \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m However, I urge you to remember that the burden of proof lies with them. They must prove guilt beyond a         \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m reasonable doubt. We will show that the evidence is circumstantial, unreliable, and lacks credibility. Mr.      \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m Wilson is presumed innocent until proven guilty, and we will demonstrate that reasonable doubt exists in this   \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m case. Thank you.                                                                                                \u001b[36m│\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "    <div style=\"\n",
       "        background: #1976d2;\n",
       "        color: white;\n",
       "        padding: 15px;\n",
       "        border-radius: 10px;\n",
       "        margin: 10px 0;\n",
       "    \">\n",
       "        <strong>⚖️ Defense</strong> • <em>Defense Attorney</em><br>\n",
       "        <div style=\"margin-top: 10px;\">Ladies and gentlemen of the jury, today you will hear the prosecution's case against my client, Mr. Wilson. However, I urge you to remember that the burden of proof lies with them. They must prove guilt beyond a reasonable doubt. We will show that the evidence is circumstantial, unreliable, and lacks credibility. Mr. Wilson is presumed innocent until proven guilty, and we will demonstrate that reasonable doubt exists in this case. Thank you.</div>\n",
       "    </div>\n",
       "    "
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<h2>📅 Day 2: Witness Testimony</h2>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╭─ </span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8; font-weight: bold\">Agent Info</span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\"> ────────────────────────────────────────────────────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>                                                                                                                 <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #ff9b9b; text-decoration-color: #ff9b9b; font-weight: bold\">👤 Agent:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Witness</span>                                                                                              <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #b4b4b3; text-decoration-color: #b4b4b3; font-weight: bold\">Role:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Provide testimony</span>                                                                                        <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>                                                                                                                 <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[38;2;210;227;200m╭─\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[1;38;2;210;227;200mAgent Info\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[38;2;210;227;200m───────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\u001b[38;2;210;227;200m─╮\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m                                                                                                                 \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;255;155;155m👤 Agent:\u001b[0m \u001b[38;2;255;229;229mWitness\u001b[0m                                                                                              \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;180;180;179mRole:\u001b[0m \u001b[38;2;255;229;229mProvide testimony\u001b[0m                                                                                        \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m                                                                                                                 \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "f4d166f4a67e41679066f05d4f224c31",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Output()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">Response generated in 2.3s</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2mResponse generated in 2.3s\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> You are a witness in \"Doe vs. Wilson\". Provide your testimony about what you saw. Evidence: Screenshots of      <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> messages, social media posts, therapist’s report Be factual and clear.                                          <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m│\u001b[0m You are a witness in \"Doe vs. Wilson\". Provide your testimony about what you saw. Evidence: Screenshots of      \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m messages, social media posts, therapist’s report Be factual and clear.                                          \u001b[36m│\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> On March 15, 2023, I observed a series of messages exchanged between Doe and Wilson on social media, indicating <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> a heated argument. The screenshots show Wilson making threatening remarks. Additionally, the therapist's report <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> dated March 20, 2023, confirms Doe's emotional distress linked to these interactions. I can confirm the         <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> authenticity of these documents.                                                                                <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m│\u001b[0m On March 15, 2023, I observed a series of messages exchanged between Doe and Wilson on social media, indicating \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m a heated argument. The screenshots show Wilson making threatening remarks. Additionally, the therapist's report \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m dated March 20, 2023, confirms Doe's emotional distress linked to these interactions. I can confirm the         \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m authenticity of these documents.                                                                                \u001b[36m│\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "    <div style=\"\n",
       "        background: #ff9800;\n",
       "        color: white;\n",
       "        padding: 15px;\n",
       "        border-radius: 10px;\n",
       "        margin: 10px 0;\n",
       "    \">\n",
       "        <strong>⚖️ Witness</strong> • <em>Court Witness</em><br>\n",
       "        <div style=\"margin-top: 10px;\">On March 15, 2023, I observed a series of messages exchanged between Doe and Wilson on social media, indicating a heated argument. The screenshots show Wilson making threatening remarks. Additionally, the therapist's report dated March 20, 2023, confirms Doe's emotional distress linked to these interactions. I can confirm the authenticity of these documents.</div>\n",
       "    </div>\n",
       "    "
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<h2>📅 Day 3: Final Verdict</h2>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╭─ </span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8; font-weight: bold\">Agent Info</span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\"> ────────────────────────────────────────────────────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>                                                                                                                 <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #ff9b9b; text-decoration-color: #ff9b9b; font-weight: bold\">👤 Agent:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Judge</span>                                                                                                <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #b4b4b3; text-decoration-color: #b4b4b3; font-weight: bold\">Role:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Preside over court proceedings</span>                                                                           <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>                                                                                                                 <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[38;2;210;227;200m╭─\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[1;38;2;210;227;200mAgent Info\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[38;2;210;227;200m───────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\u001b[38;2;210;227;200m─╮\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m                                                                                                                 \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;255;155;155m👤 Agent:\u001b[0m \u001b[38;2;255;229;229mJudge\u001b[0m                                                                                                \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;180;180;179mRole:\u001b[0m \u001b[38;2;255;229;229mPreside over court proceedings\u001b[0m                                                                           \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m                                                                                                                 \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "801192cdda5e4736bc53dba478e1dcc1",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Output()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">Response generated in 2.3s</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2mResponse generated in 2.3s\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> You are Judge presiding over \"Doe vs. Wilson\". Deliver your final verdict. Consider all evidence: Screenshots   <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> of messages, social media posts, therapist’s report Be fair and explain your reasoning.                         <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m│\u001b[0m You are Judge presiding over \"Doe vs. Wilson\". Deliver your final verdict. Consider all evidence: Screenshots   \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m of messages, social media posts, therapist’s report Be fair and explain your reasoning.                         \u001b[36m│\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> After careful consideration of the evidence presented, including the screenshots of messages, social media      <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> posts, and the therapist's report, I find that the plaintiff, Ms. Doe, has demonstrated a credible case of      <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> emotional distress due to the defendant's actions.                                                              <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span>                                                                                                                 <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> The evidence shows a pattern of harassment that has significantly impacted Ms. Doe's mental well-being.         <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> Therefore, I rule in favor of the plaintiff.                                                                    <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span>                                                                                                                 <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> Mr. Wilson is ordered to cease all forms of contact with Ms. Doe and to pay damages for the emotional distress  <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> caused. Court is adjourned.                                                                                     <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m│\u001b[0m After careful consideration of the evidence presented, including the screenshots of messages, social media      \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m posts, and the therapist's report, I find that the plaintiff, Ms. Doe, has demonstrated a credible case of      \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m emotional distress due to the defendant's actions.                                                              \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m                                                                                                                 \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m The evidence shows a pattern of harassment that has significantly impacted Ms. Doe's mental well-being.         \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m Therefore, I rule in favor of the plaintiff.                                                                    \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m                                                                                                                 \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m Mr. Wilson is ordered to cease all forms of contact with Ms. Doe and to pay damages for the emotional distress  \u001b[36m│\u001b[0m\n",
       "\u001b[36m│\u001b[0m caused. Court is adjourned.                                                                                     \u001b[36m│\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "    <div style=\"\n",
       "        background: #8B4513;\n",
       "        color: white;\n",
       "        padding: 15px;\n",
       "        border-radius: 10px;\n",
       "        margin: 10px 0;\n",
       "    \">\n",
       "        <strong>⚖️ Judge</strong> • <em>Final Verdict</em><br>\n",
       "        <div style=\"margin-top: 10px;\">After careful consideration of the evidence presented, including the screenshots of messages, social media posts, and the therapist's report, I find that the plaintiff, Ms. Doe, has demonstrated a credible case of emotional distress due to the defendant's actions.\n",
       "\n",
       "The evidence shows a pattern of harassment that has significantly impacted Ms. Doe's mental well-being. Therefore, I rule in favor of the plaintiff. \n",
       "\n",
       "Mr. Wilson is ordered to cease all forms of contact with Ms. Doe and to pay damages for the emotional distress caused. Court is adjourned.</div>\n",
       "    </div>\n",
       "    "
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "✅ Mini court simulation completed!\n"
     ]
    }
   ],
   "source": [
    "# Mini court simulation\n",
    "print(\"🚀 Starting Mini Court Simulation...\")\n",
    "\n",
    "# Day 1: Opening\n",
    "display(HTML(f\"<h2>📅 Day 1: Opening Statements</h2>\"))\n",
    "\n",
    "# Judge opens court\n",
    "judge_prompt = f\"\"\"\n",
    "You are Judge presiding over \"{case_title}\".\n",
    "Open the court proceedings professionally.\n",
    "Case: {case_description}\n",
    "Keep it brief and formal.\n",
    "\"\"\"\n",
    "judge_response = run_agent(judge, judge_prompt, \"Judge\", \"Presiding Judge\", \"#8B4513\")\n",
    "\n",
    "# Prosecutor opening\n",
    "prosecutor_prompt = f\"\"\"\n",
    "You are the Prosecutor for \"{case_title}\".\n",
    "Give your opening statement.\n",
    "Evidence: {evidence}\n",
    "Be confident and factual.\n",
    "\"\"\"\n",
    "prosecutor_response = run_agent(prosecutor, prosecutor_prompt, \"Prosecutor\", \"State Attorney\", \"#d32f2f\")\n",
    "\n",
    "# Defense opening\n",
    "defense_prompt = f\"\"\"\n",
    "You are the Defense Attorney for \"{case_title}\".\n",
    "Give your opening statement.\n",
    "Challenge the prosecution's case.\n",
    "Emphasize presumption of innocence.\n",
    "\"\"\"\n",
    "defense_response = run_agent(defense, defense_prompt, \"Defense\", \"Defense Attorney\", \"#1976d2\")\n",
    "\n",
    "time.sleep(1)\n",
    "\n",
    "# Day 2: Testimony\n",
    "display(HTML(f\"<h2>📅 Day 2: Witness Testimony</h2>\"))\n",
    "\n",
    "# Witness testimony\n",
    "witness_prompt = f\"\"\"\n",
    "You are a witness in \"{case_title}\".\n",
    "Provide your testimony about what you saw.\n",
    "Evidence: {evidence}\n",
    "Be factual and clear.\n",
    "\"\"\"\n",
    "witness_response = run_agent(witness, witness_prompt, \"Witness\", \"Court Witness\", \"#ff9800\")\n",
    "\n",
    "time.sleep(1)\n",
    "\n",
    "# Day 3: Verdict\n",
    "display(HTML(f\"<h2>📅 Day 3: Final Verdict</h2>\"))\n",
    "\n",
    "# Judge's verdict\n",
    "verdict_prompt = f\"\"\"\n",
    "You are Judge presiding over \"{case_title}\".\n",
    "Deliver your final verdict.\n",
    "Consider all evidence: {evidence}\n",
    "Be fair and explain your reasoning.\n",
    "\"\"\"\n",
    "verdict_response = run_agent(judge, verdict_prompt, \"Judge\", \"Final Verdict\", \"#8B4513\")\n",
    "\n",
    "print(\"\\n✅ Mini court simulation completed!\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0hP6lxvCRI1m",
   "metadata": {
    "id": "0hP6lxvCRI1m"
   },
   "source": [
    "# Summary"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3cc7570e",
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "3cc7570e",
    "outputId": "2960f533-2a08-45c9-8653-95817f61f6d8"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "🎯 Mini Legalia AI Complete!\n",
      "\n",
      "This simplified version demonstrates:\n",
      "- 4 Essential Agents: Judge, Prosecutor, Defense, Witness\n",
      "- 3-Day Trial: Opening, Testimony, Verdict\n",
      "- Real-time Interaction: Each agent responds based on case context\n",
      "- Easy Setup: Minimal dependencies and configuration\n",
      "\n",
      "Perfect for quick demonstrations and learning! ⚖️\n"
     ]
    }
   ],
   "source": [
    "print(\"🎯 Mini Legalia AI Complete!\")\n",
    "print(\"\\nThis simplified version demonstrates:\")\n",
    "print(\"- 4 Essential Agents: Judge, Prosecutor, Defense, Witness\")\n",
    "print(\"- 3-Day Trial: Opening, Testimony, Verdict\")\n",
    "print(\"- Real-time Interaction: Each agent responds based on case context\")\n",
    "print(\"- Easy Setup: Minimal dependencies and configuration\")\n",
    "print(\"\\nPerfect for quick demonstrations and learning! ⚖️\")"
   ]
  }
 ],
 "metadata": {
  "colab": {
   "provenance": []
  },
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "name": "python",
   "version": "3.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
